package com.thread.threadfirst.marvel.citymaster.enums;

import lombok.Getter;

/**
 * 0全部城市 1 有空位 2 即将到期
 */
@Getter
public enum SearchListStatus {

    SLS0(0, "全部城市"),
    SLS1(1, "有空位"),
    SLS2(2, "即将到期");

    /**
     *
     */
    private final String description;
    /**
     *
     */
    private final Integer value;


    /**
     * @param value
     * @param description
     */
    SearchListStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 根据key获取枚举
     *
     * @param key
     * @return
     */
    public static SearchListStatus getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (SearchListStatus temp : SearchListStatus.values()) {
            if (temp.value.equals(key)) {
                return temp;
            }
        }
        return null;
    }
}
